package cn.stylefeng.guns.modular.business.frequency.cmlinkman.mapper;

import cn.stylefeng.guns.modular.business.frequency.cmcompany.model.param.CompanyDTO;
import cn.stylefeng.guns.modular.business.frequency.cmcompany.model.param.OrderLinkmanVO;
import cn.stylefeng.guns.modular.business.frequency.cmcompany.model.result.LinkmanCheckVO;
import cn.stylefeng.guns.modular.business.frequency.cmcompany.model.result.PkgLinkman;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.business.frequency.cmlinkman.entity.CmLinkman;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 通讯录联系人表 Mapper 接口
 *
 * @author yujie
 * @date 2023/05/09 17:17
 */
public interface CmLinkmanMapper extends BaseMapper<CmLinkman> {

    Page<PkgLinkman> getLinkmanListPage(@Param("page") Page<Object> defaultPage,@Param("companyId") String companyId, @Param("companyDTO") CompanyDTO companyDTO, @Param("tenantId") Long tenantId);

    int countByPhone(@Param("phone") String phone, @Param("id") Long id,@Param("tenantId") Long tenantId);

    void deleteByCompanyId(@Param("companyId") String companyId);

    void deleteLinkman(@Param("id") String id);

    LinkmanCheckVO getLinkmanCheckDetail(@Param("id") String id);

    List<OrderLinkmanVO> getOrderLinkmanSuggest(@Param("orderLinkmanVO")OrderLinkmanVO orderLinkmanVO,@Param("tenantId") Long tenantId);

    List<OrderLinkmanVO> getOrderLinkmanSuggestAll(@Param("orderLinkmanVO")OrderLinkmanVO orderLinkmanVO,@Param("tenantId") Long tenantId);

    List<OrderLinkmanVO> getLinkmanListByIds(@Param("linkmanIds") List<String> linkmanIds);

    long countByUserIds(@Param("userIds") List<String> userIds);

    Integer getNatureById(@Param("id") Long id);

    void updateLastOrderTime(@Param("id") Long id);

    void updateLastTransportTime(@Param("id") Long id);

    void changeLinkmanOwnerUser(@Param("id") Long id, @Param("userId") Long userId);

    PkgLinkman getPkgLinkmanById(@Param("id") Long settlementId, @Param("tenantId") Long tenantId);

    List<CmLinkman> selectLinkmanListByCompanyId(@Param("companyVOId") Long companyVOId);

}